<?php
include_once '../DBAccess/DBAccess.php';
include_once '../Algos/Roof/deperditionRoof.php';
include_once '../Objects/Wall.php';
include_once '../Objects/House.php';
include_once '../Objects/Window.php';
include_once '../Objects/Roof.php';



try
  {
    $Mysql = new DBAccess('153.109.141.81:3306', 'savenrj', 'root', '');
    
    $windows1 = array();           
    $windows1[0] = new Window(1, 1, 2, true, 2 , 2.2 , 0.22, 0.1, 0.15, '', '', '', '');
    $windows1[1] = new Window(1, 1, 2, true, 2 , 2.2 , 0.22, 0.1, 0.15, '', '', '', '');
    
    $windows2 = array();
    $windows2[0] = new Window(1, 1, 2, true, 2 , 2.2 , 0.22, 0.1, 0.15, '', '', '', '');
    $windows2[1] = new Window(1, 1, 2, true, 2 , 2.2 , 0.22, 0.1, 0.15, '', '', '', '');
    
    
    
    $walls = array();
    $walls[0] = new Wall('M1', 1, 1, 60, '', $windows1, '');
    //$walls[1] = new Wall('M2', 2, 2, 60, '', $windows2, '');
    
    $roof;
    $roof = new Roof(1, 1975, '', 5);

    
    
    $house;
    
 $house = new House(4, 1, 1, 2, 50, 100, '', '', '', '', '', 77, 20, 2, 1975, $walls, '', '', $roof, '', false, false);
     //$house = new House(4, 1, 1, 'square', 'Sion', 20, 2, 1970, 150 , 30, $walls, false , false);

    
    
    $algo;
    $algo = new AlgoRoof();
    
    //echo 'TotalWin : '.$algo2->getTotalSurfaceWindows($walls);
   
    echo '<br></br>Déperdition totale';
    echo $algo->getTotalDepertitionRoof($house);
    
     echo '<br></br>SRE';
    echo $algo->getSRE($house);
    
     echo '<br></br>Surface';
    echo $algo->getTotalSurfaceRoof($house);
    
    echo '<br></br>ValeurU';
    echo $algo->getValueURoof($house);
    
    
     
  
   
    
  }
  catch (MySQLExeption $e) 
  {
    echo $e -> RetourneErreur();
  }
?>
